﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="480"
	x:Class="AllenalaMente.MainPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Landscape" Orientation="Landscape"
	shell:SystemTray.IsVisible="False" xmlns:my="clr-namespace:AllenalaMente.Menu">


  <UserControl.Resources>
    <ControlTemplate x:Key="BtnStartTmpIta" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard>
                <DoubleAnimationUsingKeyFrames  Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="pressed" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.92"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames  Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="pressed" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.92"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Image x:Name="pressed" Height="170" Width="220" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/btnStartIta.png">

          <Image.RenderTransform>
            <ScaleTransform ></ScaleTransform>
          </Image.RenderTransform>
          <Image.RenderTransformOrigin>
            <Point X="0.5" Y="0.5"></Point>
          </Image.RenderTransformOrigin>
        </Image>
        <!--<Image x:Name="pressed" Height="324" Width="623" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/giusto.png"/>-->

        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

    <!-- Btn Start-->
    <ControlTemplate x:Key="BtnStartTmp" TargetType="Button">
      <Grid>
        <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="MouseOver"/>
            <VisualState x:Name="Normal"/>
            <VisualState x:Name="Pressed">
              <Storyboard>
                <DoubleAnimationUsingKeyFrames  Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="pressed" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.92"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames  Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="pressed" BeginTime="00:00:00">
                  <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/>
                  <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0.92"/>
                </DoubleAnimationUsingKeyFrames>
              </Storyboard>
            </VisualState>
          </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Image x:Name="pressed" Height="170" Width="220" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/UI/btnStart.png">

          <Image.RenderTransform>
            <ScaleTransform ></ScaleTransform>
          </Image.RenderTransform>
          <Image.RenderTransformOrigin>
            <Point X="0.5" Y="0.5"></Point>
          </Image.RenderTransformOrigin>
        </Image>
        <!--<Image x:Name="pressed" Height="324" Width="623" Opacity="1" Stretch="Uniform" Source="/AllenalaMente;component/Assets/Images/giusto.png"/>-->

        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
      </Grid>
    </ControlTemplate>

  </UserControl.Resources>
  <!--LayoutRoot è la griglia radice in cui viene inserito tutto il contenuto della pagina-->
  <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>




    <!--TitlePanel contiene il nome dell'applicazione e il titolo della pagina-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
      <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
      <TextBlock x:Name="PageTitle" Text="page name" FontFamily="Assets/Fonts/BAVEUSE.TTF#Baveuse" Foreground="White" Margin="9,7,0,0" Style="{StaticResource PhoneTextTitle1Style}"  />
    </StackPanel>
    <!--ContentPanel - inserire qui contuto aggiuntivo-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">


      <Ellipse Name="imgprova" Fill="White" Margin="315,204,300,8">
        <Ellipse.Resources>
          <Storyboard x:Name="FlipStart" Completed="FlipStart_Completed">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransfor.AngleX)" Storyboard.TargetName="imgprova" BeginTime="00:00:00">
              <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0" />
              <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="90" />
            </DoubleAnimationUsingKeyFrames >
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransfor.AngleY)" Storyboard.TargetName="imgprova" BeginTime="00:00:00">
              <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0" />
              <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="90" />
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
          <Storyboard x:Name="FlipEnd" Completed="FlipEnd_Completed"  >
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransfor.AngleX)" Storyboard.TargetName="imgprova" BeginTime="00:00:00">
              <SplineDoubleKeyFrame KeyTime="00:00:02.2000000" Value="90" />
              <SplineDoubleKeyFrame KeyTime="00:00:02.6000000" Value="00" />
            </DoubleAnimationUsingKeyFrames >
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransfor.AngleY)" Storyboard.TargetName="imgprova" BeginTime="00:00:00">
              <SplineDoubleKeyFrame KeyTime="00:00:02.2000000" Value="90" />
              <SplineDoubleKeyFrame KeyTime="00:00:02.6000000" Value="0" />
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
        </Ellipse.Resources>

        <Ellipse.RenderTransform>
          <TransformGroup>
            <RotateTransform ></RotateTransform>
            <SkewTransform></SkewTransform>
          </TransformGroup>

        </Ellipse.RenderTransform>
      </Ellipse>


      <Button Template="{StaticResource GreenTemplate}" Content="Options" Width="220" Height="80" HorizontalAlignment="Left" Margin="528,160,0,0" Name="buttonOptions" VerticalAlignment="Top" FontSize="18" Click="buttonOptions_Click" />
      <Button Template="{StaticResource BtnStartTmp}" HorizontalAlignment="Left" Width="206" Margin="266,112,0,9" Name="buttonStart" FontSize="26" Click="buttonStart_Click" Background="#9B43F303" Foreground="#FF050B05" FontStyle="Normal" />
      <Button Template="{StaticResource RedTemplate}" Content="Game List" FontSize="22" Width="220" Height="80" HorizontalAlignment="Left" Margin="528,80,0,0" Name="buttonGameList" VerticalAlignment="Top" Click="buttonGameList_Click" />
      <Button Template="{StaticResource GreenTemplate}" Content="Credits" FontSize="18" Height="80" Width="220" HorizontalAlignment="Left" Margin="528,240,0,0" Name="buttonCredits" VerticalAlignment="Top"  Click="buttonCredits_Click"/>
      <Button Template="{StaticResource BlueTemplate}" Content="Leaderboard" FontSize="22" Height="80" Width="220" HorizontalAlignment="Left" Margin="528,-10,0,0" Name="buttonHighScores" VerticalAlignment="Top" Click="buttonHighScores_Click"/>

      <Canvas Name="CanvasComix" Margin="0,-2,0,2">

        <Ellipse Height="128" HorizontalAlignment="Left" Margin="150,32,0,0" Name="ellipse1" Stroke="Black" StrokeThickness="1" VerticalAlignment="Top" Width="257" Fill="White" />
        <Image Height="63" HorizontalAlignment="Left" Margin="211,144,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="44" Source="/AllenalaMente;component/Assets/Images/UI/Balloon.png" />
        <TextBlock Height="88" HorizontalAlignment="Left" Margin="175,50,0,0" Name="textBlockComix" Text="TextBlock" VerticalAlignment="Top" Width="206" TextAlignment="Center" Foreground="Black" FontFamily="Comic Sans MS" FontSize="24" />


      </Canvas>
    </Grid>

    <!--Banner-->
    <my:CarouselBanner HorizontalAlignment="Left" Margin="320,0,0,0" x:Name="carouselBanner" VerticalAlignment="Top" />

    <Grid.Background>
      <ImageBrush ImageSource="/AllenalaMente;component/Assets/Images/Backgrounds/SfondoMenu.jpg" Stretch="Fill" />
    </Grid.Background>
  </Grid>
</phone:PhoneApplicationPage>
